package com.iman.Confucius.service.impl.student;

import java.util.Map;

import javax.inject.Inject;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.iman.Confucius.domain.MessageDetailBean;
import com.iman.Confucius.service.MongoMessageDetailService;
import com.iman.Confucius.service.student.NoticeService;
import com.iman.Confucius.vo.student.NoticeVo;
import com.iman.common.hibernate.TemplateQLService;
import com.iman.common.support.Page;

@Service
public class NoticeServiceImpl implements NoticeService {

	@Inject
	TemplateQLService templateQLService;

	@Autowired
	private MongoMessageDetailService service;

	@Override
	public Page<NoticeVo> getNoticePage(Map<String, Object> params) {
		Integer ps = (Integer) params.get("ps");
		Integer pn = (Integer) params.get("pn");
		Page<NoticeVo> vos = templateQLService.findByPagedSQLBeanQuery(
				"notice_page_list", null, Page.getStartOfPage(pn, ps), ps,
				NoticeVo.class);
		// MongoBaseDao<MessageDetailBean> dao=new MessageDetailDaoImpl();
		// MessageDetailBean bean=new MessageDetailDaoImpl().findById("12");
		return vos;
	}

	@Override
	public MessageDetailBean getNoticeDetail(String id) {
		MessageDetailBean bean = service.findById(id);
		return bean;
	}

}
